//点击赋值
$(document).on("click",".keyboard li",function(){
    var text=$(this).text();
    var value=vue.moneyValue+text;
    changeMoneyValue(value);
});
$(document).on("click",".keyboard .delete",function(){
    var moneyValue=vue.moneyValue;
    moneyValue=moneyValue.substring(0,moneyValue.length - 1);
    changeMoneyValue(moneyValue);
});

//按钮点击效果
$(document).on("touchstart",".keyboard li,.keyboard .delete",function(){
    $(this).css({'background':'rgba(250,250,250,1)'});
});
$(document).on("touchend",".keyboard li,.keyboard .delete",function(){
    $(this).css({'background':'rgba(255,255,255,1)'});
});


function changeMoneyValue(v){
	if(v.indexOf(".")>0){
		re = /^[0-9]+\.?[0-9]{0,2}$/;
    if(re.test(v)){
			vs = v;
		}else{
			//alert("NO");
			//vs = v.substring(0,v.length-1);
		}
	}else if(v.indexOf(".")==0){
		vs = "";
		v = "";
	}else{
		re = /(0|[1-9][0-9]{0,8})[0-9]*/;
		vs = v.replace(re,"$1");
	}
	vue.moneyValue = vs;
}		